Release 10.1A: OpenEdge Development:
Java Open Clients


Managing a ProDataGraph through the update cycle

The OpenEdge ProDataGraph provides built-in support for tracking updates with its ProChangeSummary object. This object keeps track of what rows are changed (modified, added, or deleted) in the ProDataGraph and also keeps track of the original versions of modified or deleted rows so you can compare those rows against the current rows. For more information on the ProChangesSummary object, see the "ProChangeSummary class" section. In the procedure that follows, this and other OpenEdge support facilitates management of the ProDataSet update cycle in a Java Open Client application.

To manage a ProDataGraph through an update cycle:

  1. Receive your working ProDataGraph as an OUTPUT parameter of the application service. For more information, see the "Passing a ProDataGraph as OUTPUT" section.
  2. Note: While the actual parameter passing mode is application service dependent, an OUTPUT parameter is typical for an OERA-compliant application.

  3. Make changes to the ProDataGraph on the client:
    • For information on finding rows in a ProDataGraph, see the "Finding a row in a ProDataGraph" section.
    • For information on modifying rows, see the "Adding data to a ProDataGraph" section
    • For information on adding rows, see the "Adding a row to a ProDataGraph" section.
    • For information on deleting rows, see the "Deleting a row from a ProDataGraph" section.
    • Note: Because the application service sees the changes in its input ProDataSet using before-tables, all temp-tables subject to update are defined on the AppServer using the BEFORE-TABLE option. To verify that a temp-table whose data you plan to update is defined with this option, you can check the boolean value returned from the getBImageFlag() method on the ProDataObjectMetaData that corresponds to this temp-table. If the value is true, you can update the corresponding ProDataObject collection and the application service can handle the updates.

  4. Extract a separate changes-only ProDataGraph from your working ProDataGraph using the following ProChangeSummary method:
  5. Syntax
    ProDataGraph getChanges() 
    

  6. Pass the changes-only ProDataGraph back to the application service using an INPUT-OUTPUT parameter. This allows the results to be passed back to the client in the same parameter.
  7. Note: While the actual parameter passing mode is application service dependent, an INPUT-OUTPUT parameter is typical for an OERA-compliant application.

  8. Process the results from the application service in the output of the changes-only ProDataGraph that you passed to the AppServer in Step 4. This ProDataGraph now contains any additional changes, including errors, returned from the AppServer:
    1. Handle any errors that might be returned for each ProDataObject as well as the ProDataGraph as a whole. For more information on checking errors, see the "Checking for errors" section.
    2. Check the final changes in the output changes-only ProDataGraph using the methods of its ProChangeSummary object. For more information, see the "ProChangeSummary class" section. Compare the changed rows to the corresponding row in your working output ProDataGraph. Update the original row and add or delete additional required rows as described in Step 2.
  9. Once you have merged all final changes into your working ProDataGraph in Step 5, use this method to accept all changes in the ProDataGraph:
  10. Syntax
    void acceptChanges() 
    

    This clears out the list of changes in the ProChangeSummary of your ProDataGraph, allowing it to accept more changes.

  11. Delete the changes-only ProDataGraph from Step 4 and Step 5.
  12. Update any UI appropriately for your updated working ProDataGraph.
  13. You can now accept more changes to the working ProDataGraph, as in Step 2, restarting the update cycle, again.

Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095